package com.L1ngg.Demo1;

public class girlFriend {

    private int age;

    public void setAge(int age){
        if(age >= 18 && age <=24){
            this.age = age;
        }
        else
            System.out.println("年龄不符合要求");
    }

    public int getAge(){
        return age;
    }
}
